import {
  defaultMapDispatchToControlProps,
  defaultMapStateToEnumFieldProps,
  uiTypeIs,
  rankWith,
} from '@jsonforms/core';
import { connectToJsonForms } from '@jsonforms/react';
import { SelectionField } from './Selection';

/**
 * Default tester for enum controls.
 * @type {RankedTester}
 */
export const SelectionFieldTester = rankWith(3, uiTypeIs('Selection')); // overwrite default renderer (2)

export default connectToJsonForms(
  defaultMapStateToEnumFieldProps,
  defaultMapDispatchToControlProps,
)(SelectionField);
